#!python
#
# Settings for code generation using pyste.
#
do_full = False


# ------------ MATH TYPES ------------ #

# List of types to generate for the SF and MF vector
# types.  MFVec3 and MFVec4
if do_full:
   SF_MF_Vec_Types = ['ub', 'b', 'us', 's', 'f', 'd', 'ld']
else:
   SF_MF_Vec_Types = ['f']
   
# List of types to generate for the SF and MF pnt types
#  MFPnt3 and MFPnt4
if do_full:
   SF_MF_Pnt_Types = ['ub', 'b', 'us', 's', 'f', 'd', 'ld']
else:
   SF_MF_Pnt_Types = ['f']

# List of types for Vec types
if do_full:
   vec_types = { 'osg::UInt8' : 'ub',
             'osg::Int8' : 'b',
             'osg::UInt16' : 'us',
             'osg::Int16' : 's',
             'osg::Real32' : 'f',
             'osg::Real64' : 'd',
             'osg::Real128' : 'ld',
           }

   vec_sizes = [2,3,4]
else:
   vec_types = { 'osg::Real32' : 'f', }
   vec_sizes = [3,4]
        

# List of types for Pnt types
if do_full:
   pnt_types = { 'osg::UInt8' : 'ub',
             'osg::Int8' : 'b',
             'osg::UInt16' : 'us',
             'osg::Int16' : 's',
             'osg::Real32' : 'f',
             'osg::Real64' : 'd',
             'osg::Real128' : 'ld',
           }

   pnt_sizes = [2,3,4]
else:
   pnt_types = { 'osg::Real32' : 'f', }
   pnt_sizes = [3,4]

# Colors
color_types =  { 'osg::UInt8' : 'ub',
                 'osg::Real32' : 'f',
               }
color_sizes = [3,4]               
  

class MathTypeInfo(object):
   def __init__(self, type, alias, exposed_name, size, template_type):
      self.type = type
      self.alias = alias
      self.exposed_name = exposed_name
      self.size = size
      self.template_type = template_type
      
# Create VecStorage_typeinfo
# Full type, alias, module_name, size, template_type
vec_storage_typeinfo = []
for size in vec_sizes:
   for vtype in vec_types.iteritems():
      vec_storage_typeinfo.append( MathTypeInfo("osg::VecStorage%s<%s>"%(size,vtype[0]),
                                    "alias_VecStorage%s%s"%(size,vtype[1]),
                                    "VecStorage%s%s"%(size,vtype[1]),
                                    size, vtype[0]))
# Vec types
# Note: We use the osg typedefed type for the base type
# Full type, alias, module_name, size, template_type
vec_typeinfo = []
for size in vec_sizes:
   for vtype in vec_types.iteritems():
      vec_typeinfo.append( MathTypeInfo("osg::Vec%s%s"%(size,vtype[1]),
                            "alias_Vec%s%s"%(size,vtype[1]),
                            "Vec%s%s"%(size,vtype[1]),
                            size, vtype[0]) )

# Vec types
# Note: We use the osg typedefed type for the base type
# Full type, alias, module_name, size, template_type
pnt_typeinfo = []
for size in pnt_sizes:
   for ptype in pnt_types.iteritems():
      pnt_typeinfo.append( MathTypeInfo("osg::Pnt%s%s"%(size,ptype[1]),
                            "alias_Pnt%s%s"%(size,ptype[1]),
                            "Pnt%s%s"%(size,ptype[1]),
                            size, ptype[0]) )

# Color types
# Note: We use the osg typedefed type for the base type
# Full type, alias, module_name, size, template_type
color_typeinfo = []
for size in color_sizes:
   for ctype in color_types.iteritems():
      color_typeinfo.append( MathTypeInfo("osg::Color%s%s"%(size,ctype[1]),
                              "alias_Color%s%s"%(size,ctype[1]),
                              "Color%s%s"%(size,ctype[1]),
                              size, ctype[0]) )                            
